package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.DamageList;
import com.atguigu.jxc.service.DamageListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author lfh
 * @version 1.0
 * @date 2021/5/15 14:38
 */
@RestController
@RequestMapping("/damageListGoods")
public class DamageListGoodsController {

    @Autowired
    private DamageListGoodsService damageListGoodsService;

    // http://localhost:8080/damageListGoods/save?damageNumber=BS1605766644460（报损单号,前端生成）
    @PostMapping("/save")
    public ServiceVO saveDamageListGoods(DamageList damageList, String damageListGoodsStr, String damageNumber){
        return damageListGoodsService.saveDamageListGoods(damageList,damageListGoodsStr,damageNumber);
    }

    // http://localhost:8080/damageListGoods/list
    @PostMapping("/list")
    public Map<String,Object> listDamageListGoods(String  sTime, String  eTime){
        return damageListGoodsService.listDamageListGoods(sTime,eTime);
    }

    // http://localhost:8080/damageListGoods/goodsList
    @PostMapping("/goodsList")
    public Map<String,Object> goodsList(Integer damageListId){
        return damageListGoodsService.goodsList(damageListId);
    }
}
